#pragma once

#include "log_sink_file.h"


#ifdef XLOG_HEADER_ONLY

namespace xlog {

template<typename Mutex>
log_sink_file<Mutex>::log_sink_file(const filename_t &filename)
{
    m_file_hlp.open(filename);
}

template<typename Mutex>
const filename_t& log_sink_file<Mutex>::filename() const
{
    return m_file_hlp.filename();
}

template<typename Mutex>
void log_sink_file<Mutex>::sink_it(log_msg msg)
{
    log_memory_buf buf;
    m_formatter->format();
    m_file_hlp.write(buf);
    return true;
}

template<typename Mutex>
void log_sink_file<Mutex>::flush_it()
{
    m_file_hlp.flush();
}

}

#endif